/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.fd.manager.impl;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.xy.biz.fd.domain.po.DocumentRelationPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xy.biz.fd.domain.bo.DocumentRelationBO;
import com.xy.biz.fd.domain.query.DocumentRelationQuery;
import com.xy.biz.fd.domain.converter.DocumentRelationConverter;
import com.xy.biz.fd.manager.DocumentRelationManager;
import com.xy.biz.fd.dao.DocumentRelationDao;

/**
 *
 *
 * @author wcs
 * @date 2021-2-5
 */
@Service
public class DocumentRelationManagerImpl implements DocumentRelationManager {

	@Autowired
	private DocumentRelationDao documentRelationDao;

	@Override
	public int saveDocumentRelation(DocumentRelationBO documentRelationBO) {
		return documentRelationDao.saveDocumentRelation(DocumentRelationConverter.toPO(documentRelationBO));
	}

	@Override
	public int saveAllDocumentRelation(Collection<DocumentRelationBO> collection) {
		return documentRelationDao.saveAllDocumentRelation(DocumentRelationConverter.toPO(collection));
	}

	@Override
	public int updateDocumentRelation(DocumentRelationBO documentRelationBO) {
		return documentRelationDao.updateDocumentRelation(DocumentRelationConverter.toPO(documentRelationBO));
	}

	@Override
	public int updateDocumentRelationS(Collection<DocumentRelationBO> documentRelationBOS) {
		return documentRelationDao.updateDocumentRelationS(DocumentRelationConverter.toPO(documentRelationBOS));
	}

	@Override
	public int deleteDocumentRelation(Long documentRelationId) {
		return documentRelationDao.deleteDocumentRelation(documentRelationId);
	}

	@Override
	public DocumentRelationBO getDocumentRelation(Long documentRelationId) {
		return DocumentRelationConverter.fromPO(documentRelationDao.getDocumentRelation(documentRelationId));
	}

	//查单个
	@Override
	public DocumentRelationBO getDocumentRelation(DocumentRelationBO documentRelationBO) {
		return DocumentRelationConverter.fromPO(documentRelationDao.getDocumentRelation(documentRelationBO));

	}

	@Override
	public List<DocumentRelationBO> listDocumentRelationById(Collection<Long> collection) {
		return DocumentRelationConverter.fromPO(documentRelationDao.listDocumentRelationById(collection));
	}

	@Override
	public List<DocumentRelationBO> listDocumentRelation(DocumentRelationQuery query) {
		return DocumentRelationConverter.toBOByPO(documentRelationDao.listDocumentRelation(query));
	}

	@Override
	public List<DocumentRelationBO> listDocumentRelation(List<DocumentRelationBO> query) {
		List<DocumentRelationPO> documentRelationPOS = DocumentRelationConverter.toPO(query);
		return DocumentRelationConverter.fromPO(documentRelationDao.listDocumentRelationByBO(documentRelationPOS));
	}

	@Override
	public int countDocumentRelation(DocumentRelationQuery query) {
		return documentRelationDao.countDocumentRelation(query);
	}

}
